﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Models;

namespace Xingyungou.XiangLei
{
    public partial class Register : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }


        protected void Button1_Click(object sender, EventArgs e)
        {
            Yuangong yg = new Yuangong();
            yg.AdministratorName = this.tb_name.Text;
            yg.AdministratorYH = this.tb_zh.Text;
            yg.Password = this.tb_mm.Text;
            yg.Address = this.tb_dz.Text;
            yg.Phone = this.tb_dh.Text ;
            yg.Toxiang = this.tb_tx.Text;
            bool result = YuangongBLL.Zc(yg);
            if (result)
            {
                Response.Write("<script>alert('注册成功,返回登录');</script>");
                Response.Write("<script>window.location.href='Login.aspx'</script>");
            }
            else
            {
                Response.Write("<script>alert('注册失败');</script>");
                Response.Write("<script>window.location.href='Login.aspx'</script>");
            }
        }

    }
}